package czh.cocoa.graphics;

import czh.cocoa.animation.CATransform3D;
import czh.cocoa.foundation.NSObject;

public class CGAffineTransform extends NSObject {

	CATransform3D mTransform;
	
	public CGAffineTransform() {
		this(new CATransform3D());
	}
	
	public CGAffineTransform(CATransform3D t) {
		mTransform = t;
	}
	
	public void translate(float tx, float ty) {
		mTransform.translate(tx, ty, 0);
	}
	
	public void scale(float sx, float sy) {
		mTransform.scale(sx, sy, 1);
	}
	
	public void rotate(int degree) {
		mTransform.rotate(degree, 0, 0, 1);
	}
	
	public void reset() {
		mTransform.reset();
	}
	
	public CATransform3D transform3d() {
		return mTransform;
	}
	
//static calls
	
	public static CGAffineTransform CGAffineTransformMakeScale(float sx, float sy) {
		CGAffineTransform transform = new CGAffineTransform();
		transform.scale(sx, sy);
		return transform;
	}
	
}
